<title>All Courses</title>
<%@ page import="DAOPackage.ConnectionManager" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %> 
<%@ page import="java.io.*" %> 
<%@ include file="header.jsp" %>
<center>
<%
try {

Connection connection =  ConnectionManager.getConnection();
Statement statement = null;
ResultSet rs = null;
statement = connection.createStatement();
String QueryString = "SELECT * from Course";
rs = statement.executeQuery(QueryString);
%>
<TABLE>
<tr>

<th>Course Name</th>
<th>Objectives</th>
<th>Addition Date</th>
<th>Forum Link</th>
<th>Language</th>
<th>OverallRate</th>
</tr>
<%
while (rs.next()) {
%>
<tr>
<TD><a href="DisplayServlet?courseID=<%=rs.getString(1)%>"><%=rs.getString(2)%></a></TD>
<TD><%=rs.getString(3)%></TD>
<TD><%=rs.getString(4)%></TD>
<TD><a href="url"><%=rs.getString(5)%></a></TD>
<TD><%=rs.getString(6)%></TD>


</tr>

<% } %>


<%
// close all the connections.
rs.close();
statement.close();
connection.close();
} catch (Exception ex) {
%>

<font size="+3" color="red"></b>
<%
out.println("Unable to connect to database.");
}
%>
</font>
</TABLE>
</center>
<%@ include file="footer.jsp" %>